fix: Add Windows UAC execution level support to manifest template#4350
fix: Add Windows UAC execution level support to manifest template#4350leaanthony wants to merge 1 commit into
Conversation
Fixes #4349: Windows admin permissions not persisting between machines This change adds configurable UAC (User Account Control) execution level support to the Windows manifest template, allowing developers to specify admin requirements that persist when executables are distributed. ## Changes Made ### Enhanced Windows Manifest Template - Added conditional UAC `trustInfo` section to manifest template - Uses template variable `{{.ExecutionLevel}}` for dynamic configuration - Backward compatible: no UAC section when execution level not specified ### Project Configuration Support - Added `WindowsInfo` struct to project configuration - Added `executionLevel` field for specifying UAC requirements - Integrated execution level into template data processing ### Template Data Enhancement - Extended `assetData` struct to include execution level - Updated template resolution to extract Windows-specific configuration - Maintained backward compatibility with existing projects ### Documentation Updates - Added comprehensive Windows UAC guide with examples - Updated project configuration reference with Windows options - Included usage examples and supported execution levels ## Usage Developers can now specify execution level in wails.json: ```json { "info": { "windows": { "executionLevel": "requireAdministrator" } } } ``` Supported values: - `requireAdministrator`: Requires admin privileges - `asInvoker`: Runs with invoker's privileges - `highestAvailable`: Runs with highest available privileges ## Testing Verified that: - UAC trustInfo section is properly embedded in Windows executables - Admin privileges persist when executables are copied between machines - Backward compatibility maintained for existing projects - Template processing works correctly during build 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Deploying wails with
|
| Latest commit: |
e3dbe29
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://cd9b54b8.wails.pages.dev |
| Branch Preview URL: | https://fix-windows-manifest-admin-p.wails.pages.dev |



Summary
Fixes #4349: Windows admin permissions not persisting between machines
This PR adds configurable UAC (User Account Control) execution level support to the Windows manifest template, allowing developers to specify admin requirements that persist when executables are distributed to other machines.
Problem Solved
Users building Wails applications with admin privileges using custom manifest files reported that:
Root Cause
The default Wails manifest template didn't include UAC configuration options, and users trying to add their own resource files conflicted with Wails' resource embedding process.
Solution
✅ Enhanced Windows Manifest Template
trustInfosection using{{.ExecutionLevel}}template variable✅ Project Configuration Support
WindowsInfostruct to project configuration (v2/internal/project/project.go)executionLevelfield for specifying UAC requirements✅ Template Data Enhancement
assetDatastruct to include execution level field✅ Comprehensive Documentation
website/docs/guides/windows.mdx)website/docs/reference/project-config.mdx)Usage
Developers can now configure UAC execution level in
wails.json:{ "info": { "companyName": "My Company", "productName": "My App", "productVersion": "1.0.0", "windows": { "executionLevel": "requireAdministrator" } } }Supported Execution Levels
requireAdministratorhighestAvailableasInvokerTesting
✅ Verification Completed
requireAdministratorsettinggo-winres extracttooltrustInfosection properly embedded in executablerequestedExecutionLevel level="requireAdministrator"present in manifestResource Extraction Results
Files Changed
v2/internal/project/project.go- Added Windows configuration structv2/pkg/buildassets/build/windows/wails.exe.manifest- Enhanced template with UAC supportv2/pkg/buildassets/buildassets.go- Updated template data processingwebsite/docs/guides/windows.mdx- Added comprehensive UAC guidewebsite/docs/reference/project-config.mdx- Updated configuration referenceBackward Compatibility
✅ Fully backward compatible - existing projects continue to work unchanged
✅ No breaking changes - UAC section only added when explicitly configured
✅ Default behavior preserved - applications run with invoker privileges when not specified
Impact
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com